#ifndef NETWORKTASK_H
#define NETWORKTASK_H

#include <QObject>
#include <QNetworkReply>

#include "../NetworkTypes/NetworkTypes.h"

class NetworkTask : public QObject
{
    Q_OBJECT
public:
    explicit NetworkTask(QObject *parent = nullptr);
    NetworkTask(BaseRequest* request, BaseResponse* response, int taskId);
    ~NetworkTask();

    BaseRequest* getRequest() const { return m_request; }
    BaseResponse* getResponse() const { return m_response; }
    int getTaskId() const { return m_taskId; }
    void setNetworkReply(QNetworkReply* reply) { m_reply = reply; }
    QNetworkReply* getNetworkReply() const { return m_reply; }

signals:

private:
    BaseRequest* m_request;
    BaseResponse* m_response;
    QNetworkReply* m_reply = nullptr;
    int m_taskId;
};

#endif // NETWORKTASK_H
